package com.huat.sportmeetingmanagement.service.impl;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.huat.sportmeetingmanagement.dao.RecordDao;
import com.huat.sportmeetingmanagement.entity.Record;
import com.huat.sportmeetingmanagement.service.RecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class RecordServiceImpl implements RecordService {
    @Autowired
    RecordDao recordDao;


    @Override
    public Page<Record> getRecords(Record record) {
        PageHelper.startPage(record.getPageNum(),record.getPageSize());
        return recordDao.getRecords(record);
    }

    @Override
    public Integer addRecord(Record record) {
        return recordDao.addRecord(record);
    }

    @Override
    public Integer updateRecord(Record record) {
        return recordDao.updateRecord(record);
    }

    @Override
    public Integer deleteRecord(Record record) {
        return recordDao.deleteRecord(record);
    }

    @Override
    public Record getRecordById(Record record) {
        return recordDao.getRecordById(record);
    }



}
